package com.sharer.last.controller;


import com.sharer.last.base.constant.CommonConstant;
import com.sharer.last.base.model.R;
import com.sharer.last.model.vo.category.CategoryVO;
import com.sharer.last.service.CategoryService;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 分类
 *
 * @ClassName CategoryController
 * @Author wangjin
 * @Date 2023/5/5 21:06
 * @Description
 * @Version 1.0
 */
@RestController
@RequestMapping(CommonConstant.BLOG_FRONT_API + "/category")
public class CategoryController {
    @Resource
    CategoryService categoryService;

    /**
     * 按id获取分类详情
     *
     * @param id 博客id
     * @return
     */
    @GetMapping("/findById/{id}")
    public R<CategoryVO> findById(@PathVariable("id") Long id) {
        CategoryVO categoryVO = categoryService.findById(id);
        return R.ok(categoryVO);
    }
}
